package com.unism.util;

public enum InstanceStatus {
	ON_DEBUG("调试",1),ON_START("启用",2),ON_ERROR("出错",0);
	String name;
	int value;
	InstanceStatus(String n, int v){
		name = n;
		value = v;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getValue() {
		return value;
	}
	public void setValue(int value) {
		this.value = value;
	}
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		return "name:"+name+" value:"+value;
	}
	
	public static InstanceStatus valueOf(Integer value){
		
		switch(value){
		 
		case 0:
			return InstanceStatus.ON_ERROR;
		case 1:
			return InstanceStatus.ON_DEBUG;
		case 2:
			return InstanceStatus.ON_START;
		default:
				return null;
		}
	}
}
//public enum InstanceStatus {
//	ON_DEBUG("调试"),ON_START("启用"),ON_ERROR("出错");
//	String name;
//	InstanceStatus(String n){
//		name = n;
//	}
//	public String getName() {
//		return name;
//	}
//	public void setName(String name) {
//		this.name = name;
//	}
//}